//Copyright (c) Microsoft Corporation.  All rights reserved.

using System;
using System.Collections.Generic;
using System.Text;
using Eas.WebCrawler.Model.Core;

namespace Eas.WebCrawler.Model.Actions {
    internal class BaseActionFactory : ActionFactory{
        
        private GetRequestAction _GetRequestAction = new GetRequestAction();
        private GetResponseAction _GetResponseAction = new GetResponseAction();
        private ReadStreamAction _ReadStreamAction = new ReadStreamAction();
        private TerminalAction _TerminalAction = new TerminalAction();
        private PauseAction _PauseAction = new PauseAction();
        private PendingGetRequestAction _PendingGetRequestAction = new PendingGetRequestAction();

        #region ActionFactory Members

        public ProcessingAction CreateGetRequestAction(BaseProcessingState state, WorkerContext context) {
            return _GetRequestAction;
        }

        public ProcessingAction CreateTerminalAction(BaseProcessingState state, WorkerContext context) {
            return _TerminalAction;
        }

        public ProcessingAction CreateGetResponseAction(BaseProcessingState state, WorkerContext context) {
            return _GetResponseAction;
        }

        public ProcessingAction CreatePauseAction(BaseProcessingState state, WorkerContext context) {
            return _PauseAction;
        }

        public ProcessingAction CreateInitialAction(BaseProcessingState state, WorkerContext context) {
            return _GetRequestAction;
        }

        public ProcessingAction CreateStreamReadAction(BaseProcessingState state, WorkerContext context) {
            return _ReadStreamAction;
        }

        public ProcessingAction CreatePendingGetRequestAction(BaseProcessingState state, WorkerContext context) {
            return _PendingGetRequestAction;
        }

        #endregion

        #region WorkerComponent Members

        public void Initialize(WorkerContext context) {}

        #endregion
    }
}
